System, Apparatus And Method For Configurable Trusted Input/Output Access From Authorized Software

ABSTRACT

In one embodiment, an apparatus includes: a memory encryption circuit to encrypt data from a protected device, the data to be stored to a memory; and a filter circuit coupled to the memory encryption circuit, the filter circuit including a plurality of filter entries, each filter entry to store a channel identifier corresponding to a protected device, an access control policy for the protected device, and a session encryption key provided by an enclave, the enclave permitted to access the data according to the access control policy, where the filter circuit is to receive the session encryption key from the enclave in response to validation of the enclave. Other embodiments are described and claimed.

TECHNICAL FIELD

Embodiments relate to security of computing devices, and moreparticularly to secure data access.

BACKGROUND

Certain devices included in or coupled to a computing system may be usedfor communication of secure data. To this end, many platforms providecertain mechanisms to protect such devices. However existing solutionsto device access control are device-specific. For example, some originalequipment manufacturers (OEMs) protect devices such as fingerprintsensors by a dedicated coupling to a secure component in a platform.Data from the device is processed or encrypted inside the securecomponent. The secure component is in the path of data from device to asoftware application and determines when to allow data to pass throughand when to restrict it. The secure component may encrypt the databefore releasing it to authorized software, which is the only entitythat has keys to decrypt it. However, this technique does not scale wellto different devices on the platform.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of an example computer system in accordancewith an embodiment of the present invention.

FIG. 2 is a block diagram of a trusted input/output architecture inaccordance with one embodiment of the present invention.

FIG. 3 is a state diagram of a device associated with a device accesspolicy in accordance with one embodiment of the present invention.

FIG. 4 is a flow diagram of a method in accordance with an embodiment ofthe present invention.

FIG. 5 is a flow diagram of a method in accordance with anotherembodiment.

FIG. 6 is a flow diagram of a method in accordance with a still furtherembodiment of the present invention.

FIG. 7 is a flow diagram of a method in accordance with yet anotherembodiment of the present invention.

FIG. 8 is a flow diagram of a method in accordance with an additionalembodiment of the present invention.

DETAILED DESCRIPTION

In various embodiments, a trusted input/output (I/O) path between adevice and a memory is enabled for access controlled devices, such asbiometric sensors, to be used for communication of private data. Andembodiments provide platform-level, scalable techniques to controlaccess to any device connected to the platform for many different usecases, with varying throughput and processing needs.

Certain usages of I/O devices dictate that one or more devices be onlyaccessible from authorized software at all times (pre-boot andpost-boot). For example, a fingerprint sensor transmitsprivacy-sensitive user data that is controlled to only be accessible toauthorized software that matches a received fingerprint against areference template. In certain use cases, a platform may be configuredto prevent other software from gaining access to the device data. Inanother example, a system may have a policy that only authorizedsoftware can send control commands to a brake system (or other actuator)to ensure vehicle safety.

In order to enforce strict access control for such I/O devices includingsensors and actuators, among others, reliance on software alone may beinsufficient for usages that involve highly sensitive data. For example,reliance on an operating system (OS) or hypervisor to control access mayprovide a vulnerability in the system software that can be exploited tobypass the access restriction. Such vulnerability may be an especiallyreal possibility in complex system software with a large code base thatoffers large attack surfaces. In embodiments, device access controlenforced in hardware can offer higher levels of assurance against suchthreats by eliminating all malware threats.

In embodiments, hardware-based techniques are provided to enforce accesscontrol as to data from/to I/O devices, ensuring that only authorizedsoftware is able to access them. With access control mechanisms hereinonly an authorized application is able to access data from such devices,such that when authorized software is not using the device, the datafrom the device is not accessible to any other software on the platform.Access to the devices can be controlled in pre-boot and post-bootenvironments, and the access control policy is configurable, such thatthe policy is not statically built into the hardware during productionbut is user-configurable (by information technology (IT) personnel,consumer, etc.) to specify which devices are to be protected in thismanner.

In embodiments, a platform includes a hardware component called achannel filter (CF), also referred to herein as a “filter circuit” thatis in the path of I/O data between memory and I/O devices connected tothe platform. The CF can be programmed with unique device identifiers(called channel IDs (CIDs)) and the corresponding access controlpolicies that specify the software identity authorized to access datafrom those devices. In an embodiment, the device access control policyis a tuple of the form: (CID, hash of authorized enclave identity),where CID is the channel ID for the device that is being protected andthe authorized enclave's identity includes the following enclaveattributes: MR_SIGNER; PRODUCT_ID; SVN; enclave attributes andmiscellaneous features. An enclave is a piece of user-mode software thatruns in a reserved region of memory that is encrypted using a key onlyknown to the CPU. Software outside the enclave, including the OS, cannottamper with the code or data inside the enclave. In this tuple,MR_SIGNER is the cryptographic signature of the author of the enclave.The MR refers to the cryptographic measurement of the code inside theenclave. SVN refers to the Security Version Number of the enclave, usedto refer to different versions of the enclave that might have updates tothe enclave for functionality or defect fixes.

The CF is responsible for inspecting I/O data in transit to determine ifit is coming from/or going to specific I/O devices for which a policymay be programmed. If the data is coming from/or going to a device(identified by CID) for which a policy has been programmed, the CFenforces the policy. If an access is not according to the policy, datamay be dropped, and not be allowed to further proceed. For devices thatare configured to have access restriction, only authorized software canestablish ownership of the device, which is enforced by hardware thatcontrols programming of the CF by a software application.

A secure element such as a security coprocessor has a protected hardwareinterface to the CF. It is the responsibility of the secure element toprogram the access control policies into the CF early in the bootprocess. The original equipment manufacturer (OEM) may define the set ofdefault access control policies that are available on the platform. Inan embodiment, a device access control policy includes: device channelID; identity of software authorized to access the device; I/O transferdirection (input or output). In an embodiment, the OEM provisions signedaccess control policies into a basic input/output system (BIOS) or otherfirmware on the platform during manufacturing. The platform owner (e.g.,IT personnel) may select the policies to be enforced on the platform. Inturn, the BIOS may program the selected policies into the securityprocessor (one-time action) before the OS is loaded.

Early in the boot phase, the secure element on the platform programs theaccess control policies into the CF. By default, the CF drops I/O datafrom/to the device for which the policy has been programmed unlessauthorized software establishes ownership of that device by programminga session encryption key into the CF. In an embodiment, key programmingis controlled by a general-purpose processor (e.g., a central processingunit (CPU)), which also enforces that the identity of the softwareentity requesting key programming matches the identity specified in thepolicy configured earlier. The authorized software uses specialinstructions that encode its identity while requesting the CF to grantdevice access. These instructions compare the identity of the requestingsoftware against the identity included in the access control policyprogrammed into the CF during boot. If the identity of the softwarematches that encoded in the policy, the CF allows the software to accessthe device data, using a session encryption key only known to theauthorized software. After the authorized software is done using thedevice, it may remove the key (give up ownership), which causes the CFto revert to its default behavior of blocking access to the device fromall software.

The device access control policy can be provisioned to the platform onlyby a trusted entity (e.g., OEM). The OEM provisions a set of signeddevice access control policies for a platform into BIOS. The owner ofthe platform can configure BIOS to select the set of policies to beenforced on the platform (and which may be a subset of the set ofpolicies). BIOS sends the owner-selected policies to the securityprocessor. In turn, the security processor verifies the authenticity ofthe policies by verifying the signature on the policies (from the OEM).The security processor protects the policies in a given non-volatilestorage with integrity and replay protection.

A trusted execution environment (TEE) is an isolated or protectedenvironment that can protect secrets even when other parts of a systemare compromised. Examples of TEEs include Intel™ Software GuardExtensions (Intel™ SGX), secure virtual machines (VMs), and hardwareTEEs that may be implemented as a security processor such as a convergedsecurity and manageability engine (CSME). While embodiments aredescribed in the context of a particular platform having an SGX TEE andsecurity co-processor as the security element, understand the scope ofthe present invention is not limited in this regard.

Referring now to FIG. 1, shown is a block diagram of an example computersystem in accordance with an embodiment. As illustrated in FIG. 1, acomputing device 100 for secure I/O includes, among other components, aprocessor 120, main memory 132, a hardware cryptographic engine 140, andone or more I/O controllers 144 in communication with one or more I/Odevices 146. In use, cryptographic engine 140 provides on-the-flyencryption and decryption of data transferred via direct memory access(DMA) transactions between I/O controllers 144 and memory 132. Each DMAtransaction may be tagged with a CID representing a flow of dataassociated with a particular I/O device 146 or set of I/O devices 146.

Channel filter 142 is programmed, for example with channel informationand associated encryption keys, by trusted software using one or morespecialized instructions of the processor 120 to generate wrappedprogramming information. The trusted software provides the wrappedprogramming information to untrusted software such as a kernel-modedriver. The untrusted software invokes an unwrapping engine using one ormore specialized instructions of the processor 120 to unwrap theprogramming information and program the channel filter 142. By usingspecialized processor instructions to wrap the programming information,the computing device 100 may ensure that only trusted software programsthe channel filter 142. By allowing untrusted software to invoke theunwrapping engine, the computing device 100 allows system software(e.g., an operating system and/or VMM) to manage programming of thechannel filter 142.

The computing device 100 may be embodied as any type of computing systemincluding, without limitation, a computer, a desktop computer, aworkstation, a server, a laptop computer, a notebook computer, a tabletcomputer, a mobile computing device, a wearable computing device, anetwork appliance, a web appliance, a distributed computing system, aprocessor-based system, and/or a consumer electronic device. As shown inFIG. 1, the computing device 100 further includes an input/outputsubsystem 128, a data storage device 134, and communication circuitry136. Of course, the computing device 100 may include other or additionalcomponents, such as those commonly found in a desktop computer (e.g.,various input/output devices), in other embodiments. Additionally, insome embodiments, one or more of the illustrative components may beincorporated in, or otherwise form a portion of, another component. Forexample, the memory 132, or portions thereof, may be incorporated in theprocessor 120 in some embodiments.

The processor 120 may be embodied as any type of processor capable ofperforming the functions described herein, such as a single ormulti-core processor(s), digital signal processor, microcontroller, orother processor or hardware circuit. As shown, the processor 120 mayinclude hardware virtualization support 122, secure enclave support 124,and channel filter programming support 126.

The hardware virtualization support 122 supports virtualized executionof operating systems, applications, and other software by the computingdevice 100. The hardware virtualization support 122 may include virtualmachine extensions (VMX) support by providing two modes of execution:VMX-root mode and VMX non-root mode. The VMX-root mode allows executingsoftware to have broad control of the computing device 100 and itshardware resources. A hypervisor, virtual machine monitor (VMM), or hostoperating system (OS) may execute in VMX-root mode. The VMX non-rootmode restricts access to certain hardware instructions while stillimplementing the ordinary ring/privilege system of the processor 120.One or more guest OSs may execute in the VMX non-root mode. Those guestOSs may execute in ring zero, similar to being executed withoutvirtualization.

The secure enclave support 124 allows the processor 120 to establish atrusted execution environment such as a secure enclave, in whichexecuting code may be measured, verified, and/or otherwise determined tobe authentic. Additionally, code and data included in the secure enclavemay be encrypted or otherwise protected from being accessed by codeexecuting outside of the secure enclave. For example, code and dataincluded in the secure enclave may be protected by hardware protectionmechanisms of the processor 120 while being executed or while beingstored in certain protected cache memory of the processor 120. The codeand data included in the secure enclave may be encrypted when stored ina shared cache or the main memory 132. The secure enclave support 124may be embodied as a set of processor instruction extensions that allowsthe processor 120 to establish one or more secure enclaves in the memory132. For example, the secure enclave support 124 may be embodied asIntel™ SGX technology.

The channel filter programming support 126 allows the processor 120 toprogram the channel filter 142 to provide cryptographic protection ofI/O data. In particular, the processor 120 may enable or disableencryption for certain I/O channels, and may securely provide encryptionkeys to the channel filter 142 on behalf of secure enclaves. The channelfilter programming support 126 may be embodied as one or morespecialized processor instructions (e.g., the instructions EBIND,UNWRAP, or other instructions) and associated hardware, microcode,firmware, or other components of the processor 120.

The memory 132 may be embodied as any type of volatile or non-volatilememory or data storage capable of performing the functions describedherein. In operation, the memory 132 may store various data and softwareused during operation of the computing device 100 such as operatingsystems, applications, programs, libraries, and drivers. The memory 132is communicatively coupled to the processor 120 via the I/O subsystem128, which may be embodied as circuitry and/or components to facilitateinput/output operations with the processor 120, the memory 132, andother components of the computing device 100. For example, the I/Osubsystem 128 may include a secure routing component 130, a fingerprintsensor and other sensors that may measure biometric information that isto be protected using embodiments herein. In some embodiments, the I/Osubsystem 128 may form a portion of a system-on-a-chip (SoC) and beincorporated, along with the processor 120, the memory 132, and othercomponents of the computing device 100, on a single integrated circuit.

The data storage device 134 may be embodied as any type of device ordevices configured for short-term or long-term storage of data such as,for example, memory devices and circuits, memory cards, hard diskdrives, solid-state drives, or other data storage devices. In someembodiments, the data storage device 134 may be used to store thecontents of one or more secure enclaves. When stored by the data storagedevice 134, the contents of the secure enclave may be encrypted toprevent unauthorized access.

The communication circuitry 136 of the computing device 100 may beembodied as any communication circuit, device, or collection thereof,capable of enabling communications between the computing device 100 andother remote devices over a network. The communication circuitry 136 maybe configured to use any one or more communication technology (e.g.,wired or wireless communications) and associated protocols (e.g.,Ethernet, Bluetooth™, Wi-Fi™, WiMAX, etc.) to effect such communication.

In some embodiments, the computing device 100 may include a securityengine 138, which may be embodied as any hardware component(s) orcircuitry capable of providing security-related services to thecomputing device 100. In particular, the security engine 138 may includea microprocessor, microcontroller, or other embedded controller capableof executing firmware and/or other code independently and securely fromthe processor 120. Thus, the security engine 138 may be used toestablish a trusted execution environment separate from code executed bythe processor 120. The security engine 138 may communicate with theprocessor 120 and/or other components of the computing device 100 over adedicated bus. In the illustrative embodiment, the security engine 138is embodied as a CSME incorporated in an SoC of the computing device100. In some embodiments, the security engine 138 may be embodied as amanageability engine, an out-of-band processor, a Trusted PlatformModule (TPM), or other security engine device or collection of devices.Further, in some embodiments, the security engine 138 is also capable ofcommunicating using the communication circuitry 136 or a dedicatedcommunication circuit independently of the state of the computing device100 (e.g., independently of the state of the main processor 120), alsoknown as “out-of-band” communication.

The cryptographic engine 140 may be embodied as any microcontroller,microprocessor, functional block, logic, or other circuit or collectionof circuits capable of performing the functions described herein. Asfurther described below, the cryptographic engine 140 may encrypt and/ordecrypt I/O data read or written by the I/O controllers 144 in one ormore DMA operations to the memory 132. The cryptographic engine 140 may,based on information in channel filter 142, dynamically identify DMAchannel(s) to be protected. In some embodiments, the cryptographicengine 140 may be incorporated along with the I/O subsystem 128 and/orthe processor 120 in a system-on-a-chip (SoC) of the computing device100. The I/O devices 146 may be embodied as any I/O device, such ashuman interface devices, keyboards, mice, touch screens, microphones,cameras, and other input devices, as well as displays and other outputdevices.

Referring now to FIG. 2, shown is a block diagram of a trusted I/Oarchitecture in accordance with an embodiment. As illustrated in FIG. 2,architecture 200 includes a security processor 210, a filter circuit220, and a device access control policy storage 230, which may beimplemented within BIOS.

With this arrangement, initialization logic 215 within securityprocessor 210 may identify one or more device access control policies235 _(0-n) to obtain from policy storage 230 and store correspondingentries 225 _(0-n) within filter circuit 220. Then during normaloperation filter circuit 220 may mediate accesses associated withprotected devices according to the policies stored within filter circuit220. Although shown at this high level in the embodiment of FIG. 2, manyvariations and alternatives are possible. Further note that is possible,based on user configuration, that only a subset of OEM-provided policies235 within policy storage 230 may be stored in filter circuit 220.

Referring now to FIG. 3, shown is a state diagram illustrating multiplestates for devices associated with device access control policies.Specifically, as shown in state diagram 300, devices may begin in ablocked state 310 in which no entity is allowed to access data from thedevice. After appropriate programming as described herein by a trustedentity, a given device subject to an access control policy may be placedinto an unblocked state 320, in which one or more authorized entitiessuch as secure enclaves may access data from the devices. Note that FIG.3 further shows the various control transitions between the variousstates for a given filter entry (and accordingly associated protecteddevice).

With further reference to FIG. 3, a device starts in blocked state 310after the security processor programs device access policies to the CIDfilter hardware. EBIND supports the following commands to allow anenclave to control an access controlled device: CH_AC_PROTECT_ENCRYPT,which is used by the enclave to get data from the device when inunblocked state 320, encrypted with a session key; CH_AC_PROTECT_BLOCK,which is used by the enclave to put the device to blocked state 310(e.g., once the enclave is done using the device); and CH_AC_REPROGRAM,which is used by the enclave to reprogram the key associated with adevice.

Referring now to FIG. 4, shown is a flow diagram of a method inaccordance with an embodiment of the present invention. As shown in FIG.4, method 400 is a method for securely storing device access controlpolicies into a non-volatile storage of a platform. In an embodiment,method 400 may be executed as a one-time operation to load device accesscontrol policies into the platform, e.g., on an initial boot up of thesystem. To this end, method 400 may be performed by hardware circuitry,software, firmware and/or combinations thereof. In a particularembodiment, method 400 may be implemented by execution of firmware thatprovides an ability for an administrator or other user to establishconfiguration policies so that particular device access control policiesassociated with particular protected devices of the platform can bestored.

As seen, method 400 begins by receiving, in a security processor of theplatform, device access control policies from firmware (block 410). Notethat the security processor may be a standalone security coprocessor ofthe platform, which may be implemented as a separate programmableprocessor, e.g., a microcontroller of an SoC. In other cases, a separatesecurity processor that in turn couples to a general purpose processoror SoC can be used. These device access control policies set forthparameters under which data obtained from or to be provided to aprotected device is to be handled within the platform. As examples thesecurity parameters may include an indication of authorized accessors(e.g., particular authorized enclaves), encryption/decryption policiesand so forth. Note that the firmware from which these device accesscontrol policies are received may be a BIOS, e.g., as formulated by agiven OEM.

Still with reference to FIG. 4, control next passes to diamond 420 whereit is determined whether a signature of the device access controlpolicies is verified. For example, the device access control policiesmay be signed with a private key of the OEM. In this instance, thesecurity processor may verify the signature using a public key of theOEM, e.g., as stored in the platform. If verification is not successful,no further processing occurs with regard to these device access controlpolicies and they are prevented from being otherwise maintained withinthe platform (block 440). And as shown in FIG. 4, an alert may be issuedto notify, e.g., an administrator as to the error in validation.

Instead when a successful verification occurs, control passes to block430 where these device access control policies can be stored in anon-volatile storage. In embodiments, this non-volatile storage is aprotected storage associated with the security processor. In differentimplementations, the storage may be included within the securityprocessor itself or otherwise coupled to the security processor. In anyevent, the storage (or at least the portion storing these device accesscontrol policies) is protected from access to any entity other than thesecurity processor. This protected storage is integrity andreplay-protected, in an embodiment. Understand while shown at this highlevel in the embodiment of FIG. 4, many variations and alternatives arepossible.

On platform reset (in pre-boot environment), the security processorprovisions the access control policies into the CID filter forenforcement. To do this, the security processor reads the policies fromnon-volatile memory and verifies their integrity. The security processorwrites the CID of the protected device, e.g., a blocked device's DMAchannel, and its corresponding policy (identity of authorized enclave)to a filter entry of the CID filter. Thereafter the security processorremoves access for itself from a security policy register of the CIDfilter (until the next platform reset). In this way, any of the coderunning in the security processor after uploading the policy to the CFis not allowed to change the policies inside the CF, and thus minimizesthe TCB inside the security processor.

Referring now to FIG. 5, shown is a flow diagram of a method inaccordance with another embodiment. As shown in FIG. 5, method 500 is amethod for provisioning device access control policies into a filtercircuit. In embodiments herein, method 500 may be performed by hardwarecircuitry, software, firmware and/or combinations thereof. In aparticular embodiment, method 500 may be implemented within a hardwarefilter circuit and/or a security coprocessor as described herein.

As illustrated, method 500 begins by reading device access controlpolicies from the protected non-volatile storage (block 510). Thesecurity processor may read these policies from its associated protectedstorage. Next, the security processor may determine whether these deviceaccess control policies are verified (diamond 520). In an embodiment,the security processor can protect the policy by maintaining acryptographic key for integrity protection in its hardware (e.g., in afuse). The security processor also has a monotonic hardware counter.When it writes the policy to its non-volatile storage, it can integrityprotect the policy with the cryptographic key and use the hardwarecounter value for replay protection. The cryptographic integrityprotection algorithm generates a message authentication code (MAC) forthe policy that is also stored, along with the policy. Whenever thepolicy is read from storage, the security processor uses the same keyand counter value to compute the MAC. It then compares this valueagainst the MAC value stored previously. If the two match, the policywas not modified in storage.

If not verified, the security processor may raise an alert that forces auser to handle the error or takes another action such as alerting aremote administrator (block 525). In any event, the policies are notstored to the filter storage.

Still with reference to FIG. 5, if the policies are verified, controlnext passes to block 530 where a programming operation may be performed.More specifically, at block 530 the security processor may programcorresponding channel filter entries with given device access controlpolicies, along with a channel ID. In one embodiment, each channelfilter entry may include a field to store a channel identifier, whichequates to a given protected device, various control information forinteracting with the protected device, and an access control policy asdescribed herein. Note that at this point, while a filter entry isallocated for each protected device and an access control policy andother information is stored, the entry is not active until a givenauthorized enclave seeks access to the protected device. As such at thispoint of provisioning, the channel filter entries are in a blockedstate. As part of this blocked state, key information is not stored inthe entries.

To ensure that no unauthorized entity can access the filter storage andmodify the contents of any of the entries within the channel filter,next at block 540 security attribute information (SAI) may be removedfrom a security attribute policy register of the channel filter. SAIinformation of the security processor is stored in this securityattribute policy register to enable the provisioning shown in FIG. 5. Byremoving this SAI information at a conclusion of the provisioning, noother entity is allowed to modify the contents of the entries within thechannel filter during a given boot cycle, thus locking the device accesscontrol policies from unauthorized tampering. Understand while shown atthis high level in the embodiment of FIG. 5, many variations andalternatives are possible.

Authorized software is assumed (for the purpose of this discussion) torun inside an SGX enclave. In an embodiment, the authorized enclave canunlock access to the device as follows: the enclave invokes a securityinstruction (EBIND) with the CID for the device channel and a sessionencryption key; execution of the EBIND generates a blob that includesthe enclave's identity information (MR_SIGNER, PRODUCT_ID and SVN) fromits control structure (note that the blob is encrypted with a wrappingkey only known to microcode); the enclave sends the blob to the CFdriver to execute the UNWRAP instruction with the EBIND blob; executionof the UNWRAP instruction decrypts the blob using the wrapping key, andverifies that the enclave's identity matches the policy programmed intothe CID filter for the device by the security processor (duringpre-boot). If the checks pass, an entry is updated in the CID filterwith the encryption key; otherwise, an error is returned.

Note that the security processor is not involved in this unlockingoperation, as both the EBIND and UNWRAP instructions are executed on themain processor (and more specifically where EBIND is executed by theenclave and UNWRAP is executed by the filter driver).

Referring now to FIG. 6, shown is a flow diagram of a method inaccordance with a still further embodiment of the present invention. Asshown in FIG. 6, method 600 is a method for unlocking access to aprotected device, namely a device protected by a device access controlpolicy in the channel filter. As such, method 600 is a method forunlocking a device access control policy provisioned in a filtercircuit. In embodiments herein, method 600 may be performed by hardwarecircuitry, software, firmware and/or combinations thereof. In aparticular embodiment, method 600 may be implemented within a hardwarefilter circuit and/or a security coprocessor as described herein.

As illustrated, method 600 begins by sending an unlock access requestfrom an enclave to the security processor (block 610). Assume thisenclave is an entity that seeks to access data from a protected device.For example, assume that the protected device is a fingerprint reader ofa platform (and thus an input device), and the enclave is anauthentication application that relies on fingerprint scanninginformation to perform user authentication. As illustrated at block 610,this unlock access request may include a channel ID, namely a channel IDfor this protected device, a session encryption key, and an EBINDrequest. Note that the session encryption key is an encryption key thatthe enclave itself generates for use in encryption and decryption ofdata originating from the fingerprint scanner or other protected device.In an embodiment, the enclave itself may generate this ephemeral key,e.g., using a pseudo-random number generator or other entropy mechanism.In other situations, the enclave may use a hardware source of entropyvia a CPU instruction, e.g., an x86 RDRAND instruction to obtain arandom number for generating a key.

Still referring to FIG. 6, next at block 620 a binary large object(blob) may be generated that includes enclave identity information. Inan embodiment, the security processor may generate this block. The inputto the blob partly comes from the enclave. For example, the enclavesubmits the session key to the instruction, as well as the target forthe blob. In this instance, the target is the channel filter. Thebehavior of UNWRAP depends on the target encoded in the blob. The EBINDinstruction that generates the blob encrypts all the inputs from theenclave, in addition to extra information (e.g., identity of therequesting enclave), to generate the blob. The encryption key used togenerate the blob is stored in microcode and accessed by the UNBINDinstruction to decrypt the blob and perform the action depending on thetarget included in the blob.

Still with reference to FIG. 6, control next passes to block 630 wherethe security processor may request that an unwrap operation be performedon the blob. Note that this request may be sent to an untrusted portionof the SoC to perform this unwrap operation. As illustrated at block 640the blob may be decrypted with a hardware key. Note that this hardwarekey is different than the session encryption key. Namely this hardwarekey is a key only known to microcode that executes the EBIND operation.

Still referring to FIG. 6, at diamond 650 it is determined whether theenclave identity matches the identity stored in the device accesscontrol policy for the channel filter entry. If not, an error isreturned (block 670) and no unblocking of the channel filter entryoccurs. Instead if it is determined that the IDs match, such that anauthorized enclave is seeking access to the protected device, controlpasses to block 660 where the session encryption key is stored into thechannel filter entry. At this point, the given entry of the channelfilter is programmed and unblocked so that data from the protecteddevice can be encrypted, stored in memory and otherwise accessed.Understand while shown at this high level in the embodiment of FIG. 6,many variations and alternatives are possible.

If the above process completes successfully, the authorized enclave canstart accessing the encrypted data from the device's DMA channel usingthe programmed session encryption key. For input devices, the data isencrypted by hardware before it is accessible to software. Suchencrypted data may be encrypted on the fly by a crypto engine using thesession encryption key programmed by UNWRAP. For output devices, thedata that is encrypted by the authorized software is decrypted byhardware before it is sent to the device.

Referring now to FIG. 7, shown is a flow diagram of a method inaccordance with yet another embodiment of the present invention. Asshown in FIG. 7, method 700 is a method for processing incoming datafrom a protected device, namely an input device such as a fingerprintreader or other input device to receive protected information. Inembodiments herein, method 700 may be performed by hardware circuitry,software, firmware and/or combinations thereof. In a particularembodiment, method 700 may be implemented within a hardware filtercircuit and/or a security coprocessor as described herein.

Method 700 begins by receiving data from the protected device (block710). Note that this data may be received within a memory encryptionengine that is coupled between the protected device and a memory via aDMA channel. Assume that this incoming data is fingerprint data. Thememory encryption engine is configured to access the channel filterstorage to determine whether the protected device has a given accesscontrol policy stored in the channel filter (diamond 720). Note thatthis determination may be based upon a channel ID of the protecteddevice, which may be used to access the entries in the filter storage,e.g., according to a CAM technique. If there is a stored access controlpolicy, control passes to diamond 730 where it is determined whether thefilter entry is unblocked. If the entry is determined to be unblocked,next at block 740 the data may be encrypted with the session encryptionkey of the channel filter entry for the channel ID of the protecteddevice. Thereafter, this encrypted data is sent to the memory forstorage (block 750). If it is determined that there is no entry for thedevice (or the entry is blocked), the data is dropped to preventunauthorized access (block 725). Of course while shown with thisparticular implementation in the embodiment of FIG. 7, many variationsand alternatives are possible.

Referring now to FIG. 8, shown is a block diagram of a method inaccordance with an additional embodiment of the present invention. Asshown in FIG. 8, method 800 is a method for handling read requests forencrypted data. In embodiments herein, method 800 may be performed byhardware circuitry, software, firmware and/or combinations thereof. In aparticular embodiment, method 800 may be implemented in part using amemory controller that interfaces with a memory.

Method 800 begins by receiving a read request for the encrypted data(block 810). This request may be received, e.g., in a memory controllerthat in turn includes or is coupled to a memory encryption engine.Assume that this request is from an enclave seeking to access theencrypted data.

Next at block 820 the encrypted data is read, e.g., via the memorycontroller and at block 830 the encrypted data is sent to the authorizedenclave, which may decrypt the encrypted data with the sessionencryption key (block 840). Finally, at block 850 the decrypted data isprocessed in the requesting enclave, where it may be used, e.g., infurtherance of an authentication process. Of course while shown at thishigh level in the embodiment of FIG. 8, many variations and alternativesare possible.

After authorized software has completed using a device, the followingoperations are performed to lock access to the device: the enclavecreates an unprogram request in an EBIND blob with the sessionencryption key used for accessing the data from the DMA channel; theenclave requests the CF driver to execute the UNWRAP instruction withthe EBIND blob; and the UNWRAP instruction unprograms the channel fromthe CID filter and the device channel goes back to being blocked in theCID filter.

In embodiments, in order to manage an access controlled device, theenclave may be configured to furnish the device access control policy.The device access control policy includes the enclave identity and anyenclave other than the authorized enclave trying to use the accesscontrolled devices will not be able to furnish the policy and hence beblocked from using the device. The enclave populates a policy controlstructure which is used by the EBIND microcode to generate the policy.This policy control is provided as part of the input structure(BIND_STRUCT) to an EBIND instruction. The policy control structureallows the enclave to specify inclusion of one or more of the followingfields in the policy: MR_SIGNER, ISVPRODID, ISVSVN, Include Supplied SVNinstead of ISVSVN, Enclave ATTRIBUTES, Miscellaneous features.

All the fields above are included by the microcode (trusted) and notsupplied by the calling enclave. This ensures that a malicious enclavecannot fake the identity of the authorized enclave. There is oneexception to this general rule. The enclave is allowed to provide an SVNto be included instead of its current SVN. In order to allow laterversions of the authorized enclave to be able to generate an unblockingpolicy provisioned using an older version of the enclave without havingto re-provision the unblocking policy, the supplied SVN field isincluded. If the policy is set to include the supplied SVN instead ofthe SVN of the calling enclave, the microcode checks that the SVN of thecalling enclave is greater than or equal to the SVN it is requesting toinclude. If so, the supplied SVN is used for generating the policyinstead of the SVN of the calling enclave. Note that in the case wherethe SVN of the calling enclave is less than the SVN it is requesting toinclude, the generated policy will not include any SVN information.

As described above, an access controlled channel is programmed in the CFin the blocked state with an associated policy. The policy is used torepresent ownership information for the channel and only an enclave thatcan furnish this information is allowed to unblock a channel. In orderfor an enclave to be able to unblock a channel, it generates the EBINDblob to include CH_AC_PROTECT_ENCRYPT as the command to indicate anaccess controlled channel unblocking attempt. Additionally, the callingenclave sets up a policy control bit vector correctly to generate thedevice access control policy. The enclave after generating the blobappropriately for unblocking, executes EBIND to obtain a wrapped blob.Based on the policy control bit vector, the EBIND flow generates thepolicy data. The wrapped blob is then handed over to the driver stackfor programming the CID filter hardware, which executes UNWRAP to do theprogramming.

The UNWRAP flow on receiving an EBIND blob unwraps the blob and on asuccessful unwrap, proceeds to: check that the CID is in the CID filterhardware and matches the CID of an access controlled channel in theblocked state; check that the channel is not already in the encryptedstate (which translates to the fact that the channel was unblockedpreviously by an authorized enclave); and match the policy received withEBIND with the policy programmed for the access controlled channel. TheUNWRAP microcode can either read this from the CID filter on eachprogramming attempt or it can read it during initialization and maintainit internally.

If all checks above pass, the unwrap flow proceeds to unblock thechannel and protect it using encryption via the key included with theprogramming attempt. Similar to other flows, the access controlleddevice unblocking flow generates a cryptographic response for thecalling enclave to determine the status of programming. This is donewith the response key included in the EBIND blob. Table 1 below showsthe various responses possible for an access controlled deviceunblocking flow in accordance with an embodiment.

TABLE 1 Programming Return Codes Status Code in Programming ResultCryptographic Response Channel Unblocking Successful CH_PROG_SUCCESSChannel ID not in use CH_PROG_CID_UNAVAILABLE Channel already programmedCH_ALREADY_PROG to encrypted Channel policy mismatchCH_PROG_POLICY_MISMATCH

An access controlled device blocking flow allows an authorized enclaveto put an access controlled device to its original blocked state, whereall data originating from this device is blocked from reaching memory.This is done by creating an EBIND blob with CH_AC_PROTECT_BLOCK. Afterconstructing the EBIND blob, the enclave calls EBIND with the blobpassed as a parameter. EBIND generates a wrapped version of the blobwhich is passed to the untrusted software to be programmed to the CIDfilter which executes UNWRAP to do the programming.

The UNWRAP flow on receiving an EBIND blob unwraps the blob and on asuccessful unwrap proceeds to: check if the channel ID is in use; checkthat the device is not already in the blocked state; match the policyreceived with EBIND with the policy programmed for the access controlledchannel; and check that the device key with the programming attemptmatches the current device key. If the above checks pass, unwrapproceeds to block the channel. To this end, the microcode updates theCID filter hardware entry corresponding to the device to indicate thatthe device is blocked, and subsequent transactions originating from thedevice will be dropped.

Table 2 shows the response codes for a blocking attempt in accordancewith an embodiment.

TABLE 2 Programming Return Codes Status Code in Programming ResultCryptographic Response Channel Unblocking Successful CH_PROG_SUCCESSChannel ID not in use CH_PROG_CID_UNAVAILABLE Channel already programmedCH_ALREADY_PROG to encrypted Channel policy mismatchCH_PROG_POLICY_MISMATCH

The enclave might need to re-program the channel key associated with achannel for usages such as response to integrity errors. In order toreprogram the key associated with a channel, the enclave generates a newchannel key and provides the current (or old) channel key in the EBINDblob to allow the unwrap flow to establish channel ownership and allowonly the enclave that programmed the channel to re-program it. Inaddition to the old channel key, the blocking policy is also furnishedand hence the enclave sets the access controlled policy fieldsappropriately. The command field is set to reprogram the channel key,CH_AC_REPROGRAM.

The enclave, after generating the blob appropriately for reprogramming,executes EBIND to obtain a wrapped blob. The wrapped blob is handed overto untrusted software which executes the UNWRAP to do there-programming. If the channel is currently programmed, the current keypassed in EBIND blob is compared with the current channel key. Inaddition to comparing the key, the policy furnished is compared with thepolicy associated with the channel as well. This is done to establishchannel ownership as only the owner enclave can provide the old channelkey and unblocking policy. If the unwrapping and checks pass, themicrocode updates the channel key associated with the channel using thenew key received with the EBIND blob. The microcode flow then proceedsto generate a cryptographic response using the response key recoveredfrom the BIND_STRUCT.

The following examples pertain to further embodiments.

In one example, an apparatus includes: a memory encryption circuit toencrypt data from a protected device, the data to be stored to a memory;and a filter circuit coupled to the memory encryption circuit, thefilter circuit including a plurality of filter entries, each filterentry to store a channel ID corresponding to a protected device, anaccess control policy for the protected device, and a session encryptionkey provided by an enclave, the enclave permitted to access the dataaccording to the access control policy, where the filter circuit is toreceive the session encryption key from the enclave in response tovalidation of the enclave.

In an example, the apparatus further comprises a security processorcoupled to the filter circuit, the security processor, on an initialboot of a platform, to receive a first plurality of access controlpolicies from firmware and store the first plurality of access controlpolicies in a protected storage and thereafter lock the protectedstorage, the protected storage to be protected with integrity protectionand replay protection.

In an example, the apparatus comprises a system on chip having aplurality of cores, the security processor and the filter circuit.

In an example, on a reset of the platform, the security processor is toload the plurality of access control policies from the protected storageto the filter circuit in response to validation of the plurality ofaccess control policies, and thereafter prevent modification to theplurality of access control policies during a boot cycle.

In an example, the plurality of access control policies comprises asubset of the first plurality of access control policies, wherein inresponse to user configuration, the security processor is to select thesubset of the first plurality of access control policies, each of thesubset of the first plurality of access control policies associated witha protected device present in the platform.

In an example, the filter circuit is to unlock a first filter entry inresponse to a request from a first enclave, the first filter entry tostore a first access control policy for a first protected device, and inresponse to validation of the first enclave, the filter circuit is tostore in the first filter entry a first session encryption key receivedfrom the first enclave.

In an example, the memory encryption circuit is to encrypt first datafrom the first protected device with the first session encryption keyand cause the encrypted first data to be stored in the memory.

In an example, the apparatus further comprises a memory controller toreceive a read request from the first enclave for the encrypted firstdata and send the encrypted first data to the first enclave, where thefirst enclave is to decrypt the encrypted first data with the firstsession encryption key.

In an example, the filter circuit is to receive a lock request from thefirst enclave, and in response to the lock request, cause the firstfilter entry to be blocked, where the filter circuit is to remove thefirst session encryption key from the first filter entry to block thefirst filter entry.

In an example, the filter circuit is to drop second data received fromthe first protected device when the first filter entry is blocked.

In an example, the filter circuit is to send second data from a seconddevice to the memory without encryption when the second device does nothave an associated access control policy stored in a filter entry of thefilter circuit.

In another example, a method comprises: receiving, in a securityprocessor of a platform, a plurality of device access control policiesfrom a protected non-volatile storage of the platform; in response todetermining that the plurality of device access control policies areverified, programming a channel filter with a plurality of entries eachassociated with one of the plurality of device access control policies;and removing a security attribute of the security processor from apolicy register of the channel filter, to lock the channel filter for aboot cycle of the platform.

In an example, the method further comprises in response to a firstrequest from a first enclave, unblocking a first filter entry andstoring a first session encryption key in the first filter entry, toenable the first enclave to access data from a first device associatedwith the first filter entry.

In an example, the method further comprises: receiving first data fromthe first device; identifying a first access control policy in the firstfilter entry and encrypting the first data with the first sessionencryption key stored in the first filter entry; and sending the firstencrypted data to a memory for storage.

In an example, the method further comprises: in response to a readrequest for the first encrypted data from the first enclave, obtainingthe first encrypted data from the memory; and sending the firstencrypted data to the first enclave, where the first enclave is todecrypt the first encrypted data with the first session encryption key.

In an example, the method further comprises: in response to an accessrequest to the first device from a second enclave; determining whetherthe second enclave is identified in the first access control policy; andin response to determining that the second enclave is not identified inthe first access control policy, preventing the second enclave fromaccess to the first device.

In an example, the method further comprises: receiving, in the securityprocessor, the plurality of device access control policies from afirmware of the platform, on an initial boot of the platform; andstoring the plurality of device access control policies in the protectednon-volatile storage, in response to verification of the plurality ofdevice access control policies.

In another example, a computer readable medium including instructions isto perform the method of any of the above examples.

In another example, a computer readable medium including data is to beused by at least one machine to fabricate at least one integratedcircuit to perform the method of any one of the above examples.

In another example, an apparatus comprises means for performing themethod of any one of the above examples.

In another example, a system comprises: a first device to receive datafrom a user and send the data to a destination; a memory to store thedata from the first device; and a system on chip. The system on chipcomprises: at least one core; a security processor coupled to the atleast one core; a memory execution circuit coupled between the firstdevice and the memory; and a filter to store a plurality of deviceaccess control policies including a first device access control policyfor the first device, the first device access control policy comprisinga first identifier to identify the first device, a second identifier toidentify an authorized accessor of the data, and a first encryption keyprovided by the authorized accessor, where the filter is to preventother accessors from access to the data, and when the first encryptionkey is not present, to prevent the authorized accessor from access tothe data from the first device.

In an example, the security processor, on an initial boot of the system,is to receive a first plurality of device access control policies fromfirmware and store the first plurality of device access control policiesin a protected storage and thereafter lock the protected storage, wherethe plurality of device access control policies comprises a subset ofthe first plurality of device access control policies.

In an example, the filter is to unlock the first device access controlpolicy in response to a request from a first enclave, and in response tovalidation of the first enclave, the filter is to store the firstencryption key received from the first enclave in the first deviceaccess control policy, and the memory execution circuit is to encryptfirst data from the first device with the first encryption key prior tostorage in the memory.

Understand that various combinations of the above examples are possible.

Note that the terms “circuit” and “circuitry” are used interchangeablyherein. As used herein, these terms and the term “logic” are used torefer to alone or in any combination, analog circuitry, digitalcircuitry, hard wired circuitry, programmable circuitry, processorcircuitry, microcontroller circuitry, hardware logic circuitry, statemachine circuitry and/or any other type of physical hardware component.Embodiments may be used in many different types of systems. For example,in one embodiment a communication device can be arranged to perform thevarious methods and techniques described herein. Of course, the scope ofthe present invention is not limited to a communication device, andinstead other embodiments can be directed to other types of apparatusfor processing instructions, or one or more machine readable mediaincluding instructions that in response to being executed on a computingdevice, cause the device to carry out one or more of the methods andtechniques described herein.

Embodiments may be implemented in code and may be stored on anon-transitory storage medium having stored thereon instructions whichcan be used to program a system to perform the instructions. Embodimentsalso may be implemented in data and may be stored on a non-transitorystorage medium, which if used by at least one machine, causes the atleast one machine to fabricate at least one integrated circuit toperform one or more operations. Still further embodiments may beimplemented in a computer readable storage medium including informationthat, when manufactured into a SoC or other processor, is to configurethe SoC or other processor to perform one or more operations. Thestorage medium may include, but is not limited to, any type of diskincluding floppy disks, optical disks, solid state drives (SSDs),compact disk read-only memories (CD-ROMs), compact disk rewritables(CD-RWs), and magneto-optical disks, semiconductor devices such asread-only memories (ROMs), random access memories (RAMs) such as dynamicrandom access memories (DRAMs), static random access memories (SRAMs),erasable programmable read-only memories (EPROMs), flash memories,electrically erasable programmable read-only memories (EEPROMs),magnetic or optical cards, or any other type of media suitable forstoring electronic instructions.

While the present invention has been described with respect to a limitednumber of embodiments, those skilled in the art will appreciate numerousmodifications and variations therefrom. It is intended that the appendedclaims cover all such modifications and variations as fall within thetrue spirit and scope of this present invention.

What is claimed is:
 1. An apparatus comprising: a memory encryptioncircuit to encrypt data from a protected device, the data to be storedto a memory; and a filter circuit coupled to the memory encryptioncircuit, the filter circuit including a plurality of filter entries,each filter entry to store a channel identifier (ID) corresponding to aprotected device, an access control policy for the protected device, anda session encryption key provided by an enclave, the enclave permittedto access the data according to the access control policy, wherein thefilter circuit is to receive the session encryption key from the enclavein response to validation of the enclave.
 2. The apparatus of claim 1,further comprising a security processor coupled to the filter circuit,the security processor, on an initial boot of a platform, to receive afirst plurality of access control policies from firmware and store thefirst plurality of access control policies in a protected storage andthereafter lock the protected storage, the protected storage to beprotected with integrity protection and replay protection.
 3. Theapparatus of claim 2, wherein the apparatus comprises a system on chiphaving a plurality of cores, the security processor and the filtercircuit.
 4. The apparatus of claim 2, wherein on a reset of theplatform, the security processor is to load the plurality of accesscontrol policies from the protected storage to the filter circuit inresponse to validation of the plurality of access control policies, andthereafter prevent modification to the plurality of access controlpolicies during a boot cycle.
 5. The apparatus of claim 2, wherein theplurality of access control policies comprises a subset of the firstplurality of access control policies, wherein in response to userconfiguration, the security processor is to select the subset of thefirst plurality of access control policies, each of the subset of thefirst plurality of access control policies associated with a protecteddevice present in the platform.
 6. The apparatus of claim 1, wherein thefilter circuit is to unlock a first filter entry in response to arequest from a first enclave, the first filter entry to store a firstaccess control policy for a first protected device, and in response tovalidation of the first enclave, the filter circuit is to store in thefirst filter entry a first session encryption key received from thefirst enclave.
 7. The apparatus of claim 6, wherein the memoryencryption circuit is to encrypt first data from the first protecteddevice with the first session encryption key and cause the encryptedfirst data to be stored in the memory.
 8. The apparatus of claim 7,further comprising a memory controller to receive a read request fromthe first enclave for the encrypted first data and send the encryptedfirst data to the first enclave, wherein the first enclave is to decryptthe encrypted first data with the first session encryption key.
 9. Theapparatus of claim 6, wherein the filter circuit is to receive a lockrequest from the first enclave, and in response to the lock request,cause the first filter entry to be blocked, wherein the filter circuitis to remove the first session encryption key from the first filterentry to block the first filter entry.
 10. The apparatus of claim 9,wherein the filter circuit is to drop second data received from thefirst protected device when the first filter entry is blocked.
 11. Theapparatus of claim 1, wherein the filter circuit is to send second datafrom a second device to the memory without encryption when the seconddevice does not have an associated access control policy stored in afilter entry of the filter circuit.
 12. At least one computer readablestorage medium having stored thereon instructions, which if performed bya machine cause the machine to perform a method comprising: receiving,in a security processor of a platform, a plurality of device accesscontrol policies from a protected non-volatile storage of the platform;in response to determining that the plurality of device access controlpolicies are verified, programming a channel filter with a plurality ofentries each associated with one of the plurality of device accesscontrol policies; and removing a security attribute of the securityprocessor from a policy register of the channel filter, to lock thechannel filter for a boot cycle of the platform.
 13. The at least onecomputer readable storage medium of claim 12, wherein the method furthercomprises in response to a first request from a first enclave,unblocking a first filter entry and storing a first session encryptionkey in the first filter entry, to enable the first enclave to accessdata from a first device associated with the first filter entry.
 14. Theat least one computer readable storage medium of claim 13, wherein themethod further comprises: receiving first data from the first device;identifying a first access control policy in the first filter entry andencrypting the first data with the first session encryption key storedin the first filter entry; and sending the first encrypted data to amemory for storage.
 15. The at least one computer readable storagemedium of claim 14, wherein the method further comprises: in response toa read request for the first encrypted data from the first enclave,obtaining the first encrypted data from the memory; and sending thefirst encrypted data to the first enclave, wherein the first enclave isto decrypt the first encrypted data with the first session encryptionkey.
 16. The at least one computer readable storage medium of claim 14,wherein the method further comprises: in response to an access requestto the first device from a second enclave; determining whether thesecond enclave is identified in the first access control policy; and inresponse to determining that the second enclave is not identified in thefirst access control policy, preventing the second enclave from accessto the first device.
 17. The at least one computer readable storagemedium of claim 12, wherein the method further comprises: receiving, inthe security processor, the plurality of device access control policiesfrom a firmware of the platform, on an initial boot of the platform; andstoring the plurality of device access control policies in the protectednon-volatile storage, in response to verification of the plurality ofdevice access control policies.
 18. A system comprising: a first deviceto receive data from a user and send the data to a destination; a memoryto store the data from the first device; and a system on chipcomprising: at least one core; a security processor coupled to the atleast one core; a memory execution circuit coupled between the firstdevice and the memory; and a filter to store a plurality of deviceaccess control policies including a first device access control policyfor the first device, the first device access control policy comprisinga first identifier to identify the first device, a second identifier toidentify an authorized accessor of the data, and a first encryption keyprovided by the authorized accessor, wherein the filter is to preventother accessors from access to the data, and when the first encryptionkey is not present, to prevent the authorized accessor from access tothe data from the first device.
 19. The system of claim 18, wherein thesecurity processor, on an initial boot of the system, is to receive afirst plurality of device access control policies from firmware andstore the first plurality of device access control policies in aprotected storage and thereafter lock the protected storage, wherein theplurality of device access control policies comprises a subset of thefirst plurality of device access control policies.
 20. The system ofclaim 18, wherein the filter is to unlock the first device accesscontrol policy in response to a request from a first enclave, and inresponse to validation of the first enclave, the filter is to store thefirst encryption key received from the first enclave in the first deviceaccess control policy, and the memory execution circuit is to encryptfirst data from the first device with the first encryption key prior tostorage in the memory.